﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChangePassword.aspx.cs"
	Inherits="UCenter.Web.Views.Account.ChangePassword" %>

<asp:content id="changePasswordContent" contentplaceholderid="MainContent" runat="server">

    <script type="text/javascript">
        $(document).ready(function(){
            $("#form_changePassword").validate( {
                rules: {
                    currentPassword: {
                        required: true,
                        minlength: 8,
                        remote: '<%= Url.Action("IsValidatePassword", "Account") %>'
                    },
                    newPassword: {
                        required: true,
                        minlength: 8
                    },
                    confirmPassword: {
                        required: true,
                        minlength: 8,
                        equalTo: "#newPassword"
                    }
                },
                messages: {
                    currentPassword: {
                        required: "密码不能为空",
                        minlength: "密码长度最小为8位",
                        remote: "当前密码有误，请检查"
                    },
                    newPassword: {
                        required: "密码不能为空",
                        minlength: "密码长度最小为8位"
                    },
                    confirmPassword: {
                        required: "确认密码不能为空",
				        minlength: "密码长度最小为8位",
				        equalTo: "两次输入密码不一致"
				    }
                }  
            });
        });  
    </script>

	<div class="form1">
		<h3>修改密码</h3>
		<p>
			New passwords are required to be a minimum of <%=Html.Encode(ViewData["PasswordLength"])%> characters in length.
		</p>
		<%
			IList<string> errors = ViewData["errors"] as IList<string>;
			if(errors != null)
			{
			%>
				<ul class="error">
				<% foreach(string error in errors)
				   { %>
					<li><%= Html.Encode(error) %></li>
				<% } %>
				</ul>
			<%
				}
		%>
		
		<form id="form_changePassword" method="post" action="<%= Html.AttributeEncode(Url.Action("ChangePassword", "Account")) %>">
			<p>
				<label for="currentPassword">当前密码：</label>
				<%= Html.Password("currentPassword", new { @class = "f-text"}) %>
			</p>
			<p>
				<label for="newPassword">新密码：</label>
				<%= Html.Password("newPassword", new { @class = "f-text"}) %>
			</p>
			<p>
				<label for="confirmPassword">确认密码：</label>
				<%= Html.Password("confirmPassword", new { @class = "f-text"}) %>
			</p>
			<p><%= Html.SubmitButton("changePassword", "修改密码", new { @class = "f-button" })%></p>
		</form>
	</div>




</asp:content>
